package com.xiangyi.teachingsystem.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiangyi.teachingsystem.entity.po.CourseRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CourseResMapper extends BaseMapper<CourseRes> {

    @Select("select * from course_res where course_id=#{courseId}")
    List<CourseRes> list(Integer courseID);

    @Select("SELECT cr.*,c.`course_name` res_course_name\n" +
            "FROM course_res cr\n" +
            "LEFT JOIN course c\n" +
            "ON cr.course_id=c.id")
    List<CourseRes> courseResList();
}
